home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
basnet.arc
/
SPLFLG.BAS
< prev
Wrap
BASIC Source File
|
1987-06-12
|
9KB
|
196 lines
100 GOSUB 10000 'set up the network access and library calls
1000 ' SET DEFAULT SPOOL FLAGS
1001 ' FIRST GET THE CURRENT DEFAULT SETTINGS
1002 REQ$ = STRING$(25,0): MODE% = 0
1004 DEF SEG= LIBSEG
1006 CALL SETSPL(REQ$,MODE%)
1008 DEF SEG
1010 CLS
1012 IF ASC(MID$(REQ$,1,1)) = 0 THEN STAT$ = "ENABLED" ELSE STAT$ = "DISABLED"
1013 PF% = ASC(MID$(REQ$,2,1))
1014 FF% = PF% MOD 16
1015 DELFILE% = (PF% - FF%) MOD 64
1016 TABENABLE% = (PF% - FF% - DELFILE%) MOD 128
1017 BANPAGE% = (PF% \ 128) * 128
1018 TABS% = ASC(MID$(REQ$,3,1))
1019 PTRNUM% = ASC(MID$(REQ$,4,1))
1020 NUMCOPS% = ASC(MID$(REQ$,5,1))
1021 FTYPE% = ASC(MID$(REQ$,6,1))
1022 BTEXT$ = MID$(REQ$,8,13)
1023 LPTR% = ASC(MID$(REQ$,22,1))
1024 TOUT! = CVI(MID$(REQ$,23,2))
1025 DEVICE% = ASC(MID$(REQ$,25,1))
1030 PRINT "******** DEFAULT SPOOL FLAGS ARE (WILL BE) ********
1035 PRINT "1."
1040 PRINT
1045 PRINT "2. Auto form feed:
1050 PRINT "3. Delete file after print:
1055 PRINT "4. Enable tab expansion: "
1060 PRINT "5. Print banner page: "
1065 PRINT
1070 PRINT "6. Tab size (1-20): "
1075 PRINT "7. Network printer #: "
1080 PRINT "8. Copies: "
1085 PRINT "9. Form type: "
1090 PRINT "10. Banner text (13 chars max):
1095 PRINT "11. Local printer:"
1100 PRINT "12. Time out (1/18ths of seconds):"
1105 PRINT "13. Device close endspool:"
1110 PRINT "********************************************"
1115 LOCATE 2,4: PRINT STAT$ " "
1116 LOCATE 4,20: IF FF% = 0 THEN PRINT "YES" ELSE PRINT "NO "
1117 LOCATE 5,29: IF DELFILE% = 0 THEN PRINT "NO " ELSE PRINT "YES"
1118 LOCATE 6,26: IF TABENABLE% = 64 THEN PRINT "YES" ELSE PRINT "NO "
1119 LOCATE 7,23: IF BANPAGE% = 128 THEN PRINT "YES" ELSE PRINT "NO "
1120 LOCATE 9,21: PRINT TABS% SPC(20)
1121 LOCATE 10,23: PRINT PTRNUM% SPC(20)
1122 LOCATE 11,12: PRINT NUMCOPS% SPC(20)
1123 LOCATE 12,15: PRINT FTYPE% SPC(20)
1124 LOCATE 13,33: PRINT BTEXT$ SPC(20)
1125 LOCATE 14,20: PRINT LPTR% SPC(20)
1126 LOCATE 15,36: PRINT TOUT! SPC(20)
1127 LOCATE 16,28: IF DEVICE% = 0 THEN PRINT "YES" ELSE PRINT "NO "
1128 LOCATE 19,1: PRINT SPC(78): LOCATE 19,1
1129 INPUT "Select setting to change, <enter> to exit, or 'S'et: ",v$
1130 IF V$ = "" THEN GOTO 200
1132 IF V$ <> "s" AND V$ <> "S" THEN GOTO 1177
1133 IF STAT$ = "ENABLED" THEN REP$ = CHR$(0) ELSE REP$ = CHR$(1)
1134 REP$ = REP$ + CHR$(FF%+DELFILE%+TABENABLE%+BANPAGE%) + CHR$(TABS%)
1136 REP$ = REP$ + CHR$(PRTNUM%) + CHR$(NUMCOPS%) + CHR$(FTYPE%) + CHR$(0)
1137 REP$ = REP$ + BTEXT$ + STRING$(13-LEN(BTEXT$),0) + CHR$(0) + CHR$(LPTR%)
1138 REP$ = REP$ + CHR$(TOUT!\256) + CHR$(TOUT! MOD 256) + CHR$(DEVICE%)
1139 REP$ = CHR$(25)+CHR$(0) + REP$
1140 MODE% = 1
1145 DEF SEG = LIBSEG
1146 print rep$
1150 CALL SETSPL(REP$,MODE%)
1160 DEF SEG
1165 print "line 1165"
1175 INPUT "DEFAULT SPOOL FLAGS SET!! <enter> ",v$
1176 goto 1500
1177 print v%
1180 V% = VAL(V$)
1185 ON V% GOTO 1200,1210,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420
1190 GOTO 1115
1200 IF STAT$ = "ENABLED" THEN STAT$ = "DISABLED" ELSE STAT$ = "ENABLED"
1205 GOTO 1115
1210 IF FF% = 8 THEN FF% = 0 ELSE FF% = 8
1215 GOTO 1115
1220 IF DELFILE% = 32 THEN DELFILE% = 0 ELSE DELFILE% = 32
1230 GOTO 1115
1240 IF TABENABLE% = 64 THEN TABENABLE% = 0 ELSE TABENABLE% = 64
1250 GOTO 1115
1260 IF BANPAGE% = 128 THEN BANPAGE% = 0 ELSE BANPAGE% = 128
1270 GOTO 1115
1280 LOCATE 21,1: INPUT "New tab size: ",TABS%
1283 LOCATE 21,1: PRINT SPC(70)
1286 IF TABS% < 1 OR TABS% > 20 THEN 600
1290 GOTO 1115
1300 LOCATE 21,1: INPUT "Network printer #: ",PTRNUM%
1305 LOCATE 21,1: PRINT SPC(70)" "
1310 GOTO 1115
1320 LOCATE 21,1: INPUT "Number of copies to print: ",NUMCOPS%
1325 LOCATE 21,1: PRINT SPC(70)""
1330 GOTO 1115
1340 LOCATE 21,1: INPUT "Form type (0 - 255): ",ftype%
1345 LOCATE 21,1: PRINT SPC(70)
1350 GOTO 1115
1360 LOCATE 21,1: INPUT "Banner name (1-13 chars): ",BTEXT$
1365 LOCATE 21,1: PRINT SPC(70)
1375 GOTO 1115
1380 LOCATE 21,1: INPUT "Local printer (LPT 1,2, or 3): ",lptr%
1385 LOCATE 21,1: PRINT SPC(70)
1390 GOTO 1115
1400 LOCATE 21,1: INPUT "Time out value (1/18ths of sec.): ",tout!
1405 LOCATE 21,1: PRINT SPC(70)
1410 GOTO 1115
1420 IF DEVICE% = 0 THEN DEVICE% = 1 ELSE DEVICE% = 0
1430 GOTO 1115
1500 END
10000 '
10010 ' routines for network use
10020 '
10100 ' This file contains the routine names and
10101 ' offsets for the BASNET library
10110 XTNDOPN = 0 'xtndopn(Mode%, Filename$, Handle%, ErrCode%)
10111 SETATTR = 3 'setattr(Func%, Filename$, Attribute%, ErrCode%)
10112 EOJSTAT = 6 'eojstat(Flag%)
10113 PRLH.LOG = 9 'PRLH.Log(FileHandle%,HiByteOffset%,LoByteOffset%,HiLockLen%,LoLockLen%,Flags%,TimeOut%,ErrCode%)
10114 PRLH.REL = 12 'PRLH.Rel(FileHandle%,HiByteOffset%,LoByteOffset%,ErrCode%)
10115 PRLH.CLR = 15 'PRLH.Clr(FileHandle%,HiByteOffset%,LoByteOffset%,Errcode%)
10116 PRLF.LOG = 18 'PRLF.Log(fcb%,HiByteOffset%,LoByteOffset%,HiLockLen%,LoLockLen%,Flags%,TimeOut%,ErrCode%)
10117 PRLF.REL = 21 'PRLF.Rel(fcb%,HiByteOffset%,LoByteOffset%,ErrCode%)
10118 PRLF.CLR = 24 'PRLF.Clr(fcb%,HiByteOffset%,LoByteOffset%,ErrCode%)
10119 PRLS.LCK = 27 'PRLS.Lck(Flags%,TimeOut%,ErrCode%)
10120 PRLS.REL = 30 'PRLS.Rel(ErrCode%)
10121 PRLS.CLR = 33 'PRLS.Clr(ErrCode%)
10122 OPENSEM = 36 'OpenSem(Sema4$,SemaValu%,HiHandle%,LoHandle%,OpenCnt%,RetCode%)
10123 EXAMSEM = 39 'ExamSem(HiHandle%,LoHandle%,SemaValu%,OpenCnt%,RetCode%)
10124 WAITSEM = 42 'WaitSem(HiHandle%,LoHandle%,TimeOut%,RetCode%)
10125 SIGSEM = 45 'SigSem(HiHandle%,LoHandle%,RetCode%)
10126 CLOSSEM = 48 'ClosSem(HiHandle%,LoHandle%,RetCode%)
10127 SETLCK = 51 'setlck(Func%,Mode%)
10128 BAKOUTS = 54 'Bakouts(Func%,RetCode%)
10129 BTRANS = 57 'btran(ReturnCode%, Mode%)
10130 ETRANS = 60 'etrans(ReturnCode%)
10131 EXCLOG = 63 'exclog(ReturnCode%, FcbAddr)
10132 EXCLCKS = 66 'exclcks(ReturnCode%, Mode%)
10133 EXCULKF = 69 'exculkf(ReturnCode%, FcbAddr)
10134 EXCULKS = 72 'exculks(ReturnCode%)
10135 EXCCLRF = 75 'excclrf(ReturnCode%, FcbAddr)
10136 EXCCLRS = 78 'excclrs(ReturnCode%)
10137 RECLOG = 81 'reclog(ReturnCode%, String$)
10138 RECLCK = 84 'reclck(ReturnCode%, Mode%)
10139 RECULK = 87 'reculk(ReturnCode%, Semaphore$)
10140 RECULKS = 90 'reculks(ReturnCode%)
10141 RECCLR = 93 'recclr(ReturnCode%, Semaphore$)
10142 RECCLRS = 96 'recclrs(ReturnCode%)
10143 EOJ = 99 'eoj(ReturnCode%)
10144 SYSOUT = 102 'sysout(ReturnCode%)
10145 ALLOCR = 105 'allocr(ReturnCode%, Resource%)
10146 DALLOCR = 108 'dallocr(ReturnCode%, Resource%)
10147 VOLSTAT = 111 'volstat(volume%, reply$)
10148 LOCDRV = 114 'locdrv(NumDisks%)
10149 WSID = 117 'wsid(ThisStationNum%)
10150 ERRMODE = 120 'errmode(mode%)
10151 BCSMODE = 123 'bcsmode(mode%)
10152 CTLSPL = 126 'ctlspl(mode%)
10153 SPLREQ = 129 'splreq(ErrCode%, RequestBlock$, Reply$)
10154 PIPREQ = 132 'pipreq(ErrCode%, RequestBlock$, Reply$)
10155 DPATH = 135 'dpath(ReturnCode%, RequestBlock$, Reply$)
10156 SYSLOG = 138 'syslog(ReturnCode%, RequestBlock$, Reply$)
10157 FATTR = 141 'fattr(ReturnCode%, FcbAddr, Attribute%)
10158 UPDFCB = 144 'updfcb(RetCode%,FcbAddr)
10159 CPYFILE = 147 'cpyfile(ReturnCode%, FcbSource, FcbDest, CountLow, CountHigh)
10160 NETTOD = 150 'nettod(time$)
10161 CLSMODE = 153 'clsmode(mode%)
10162 DRVMAP = 156 'drvmap(ReturnFlags%, drive%)
10163 RETSHL = 159 'retshl(RetCode%, Mode%)
10164 ASCLOG = 162 'asclog(RetCode%, Asciiz$)
10165 ASCULKF = 165 'asculkf(RetCode%, Asciiz$)
10166 ASCCLRF = 168 'ascclrf(RetCode%, Asciiz$)
10167 GETPSN = 171 'Get_PSN(StationNo%)
10168 GETSTA = 174 'Get_STA(Mode%,Segment%,Offset%)
10169 SETSERV = 177 'SetServ(Mode%,NewServ%,CurrServ%)
10170 MODSERV = 180 'ModServ(Mode%,NewServ%,RetCode%)
10171 GETDRV = 183 'GetDrv(Drive%)
10172 SETSPL = 186 'setspl(Request$,mode%)
10173 LOGLCK = 189 'loglck(
10200 '
10210 ' Assign the segment address for the library to the variable LibSeg
10220 DEF SEG = 0
10230 SUBOFF = PEEK(&H4F0)+(256*PEEK(&H4F1))
10240 SUBSEG = PEEK(&H4F2)+(256*PEEK(&H4F3))
10250 LIBSEG = SUBSEG
10400 '
10410 ' set the error mode so its more informative
10420 DEF SEG = LIBSEG
10430 NEWMODE% = 1
10440 CALL ERRMODE(NEWMODE%)
10450 DEF SEG
10999 RETURN